package com.xfcy.blog.valid;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import static java.lang.annotation.ElementType.*;
import static java.lang.annotation.ElementType.TYPE_USE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

/**
 * 自定义检验注解（相当于 @Min+@Max）
 * @author 晓风残月Lx
 * @date 2023/4/20 23:58
 */
@Documented
@Constraint(validatedBy = {SimpleValueConstraintValidator.class})
@Target({ METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER, TYPE_USE })
@Retention(RUNTIME)
public @interface SimpleValue {

    String message() default "参数位数不对，请检查";

    Class<?>[] groups() default { };

    Class<? extends Payload>[] payload() default { };

    long value();



}
